﻿using System.Diagnostics;
using System;

namespace UnitDriven
{
    public abstract class TestBase
    {
#if SILVERLIGHT
        private UnitTestContext _context;

        protected TestBase()
        {
            _context = new UnitTestContext();
        }

        /// <summary>
        /// Unit Driven will create a separate instance of the test object for each test. You only need a single instance.
        /// </summary>
        /// <returns></returns>
        public UnitTestContext GetContext()
        {
            return _context;
        }
#else
        /// <summary>
        /// In .net NUnit will create a single intance and run all of the tests on that one instance.
        /// Each call to get context must return a unique instance.
        /// </summary>
        /// <returns></returns>
        public UnitTestContext GetContext()
        {
            return new UnitTestContext();
        }
#endif
    }
}
